Investigate what's up with AddScriptLPS() and AddToScriptLPS(). 🔼

Think that's entirely bogus and just a waste of time.

If I read the code correctly, it's ending up in the wrong place in the statistics bar.


reported=2019-05-19 07:42:39

reporter=onefang

priority=low

category=Bug

severity=tweak

resolution=won't fix


2019-06-01 13:58:48 onefang: In the various script function sources (once per function call, not per line) -

[list]

[*]SceneObjectPart m_host;

[*]m_host.AddScriptLPS(1);

[/list]

Region/Framework/Scenes/SceneObjectPart.cs (prims)

[list]

[*]SceneObjectGroup m_parentGroup;

[*]AddScriptLPS(int count) ParentGroup.AddScriptLPS(count);

[/list]

Region/Framework/Scenes/SceneObjectGroup.cs (linked set of prims)

[list]

[*]Scene m_scene (mumble mumble OOPs mumble mumble)

[*]AddScriptLPS(int count) m_scene.SceneGraph.AddToScriptLPS(count);

[/list]

Region/Framework/Scenes/SceneGraph.cs

[list]

[*]AddToScriptLPS(int number) m_scriptLPS += number;

[*]GetScriptLPS() returnval = mscriptLPS; mscriptLPS = 0;

[/list]

Region/Framework/Scenes/SimStatsReporter.cs

[list]

[*]public event SendStatResult OnSendStatsResult;

[*]int m_scriptEventsPerSecond;

[*]SimStatsPacket.StatBlock[] sbex = new SimStatsPacket.StatBlock[m_statisticExtraArraySize];

[*]mscriptLinesPerSecond = mscene.SceneGraph.GetScriptLPS();

[*]sbex[0].StatID = (uint)Stats.LSLScriptLinesPerSecond;

[*]sbex[0].StatValue = m_scriptLinesPerSecond * updateTimeFactor;

[*]lastReportedSimStats[38] = m_scriptLinesPerSecond * updateTimeFactor;

[*]SimStats simStats = new SimStats( ... sbex, ...) // sbex becomes SimStats.m_extraStatsBlock

[*]handlerSendStatResult = OnSendStatsResult;

[*]handlerSendStatResult(simStats);

[/list]

Region/CoreModules/Framework/Monitoring/MonitorModule.cs

[list]

[*]m_staticMonitors.Add( new GenericMonitor( ...

[*] "SpareFrameTimeMonitor", "Spare Frame Time",

[*] m => m.Scene.StatsReporter.LastReportedSimStats[38],

[*] m => string.Format("{0} ms", m.GetValue())));

[/list]

So via lastReportedSimStats[38], "script lines per second" ends up being reported as "Spare Frame Time", which is doubly bogus.

sbex is tracked in the next note.


2019-06-01 14:57:13 onefang: Region/OptionalModules/UserStatistics/WebStatsModule.cs

[list]

[*]scene.StatsReporter.OnSendStatsResult += ReceiveClassicSimStatsPacket;

[*]ReceiveClassicSimStatsPacket(SimStats stats)

[*] USimStatsData ss = m_simstatsCounters[stats.RegionUUID];

[*] ss.ConsumeSimStats(stats);

[*] ConsumeSimStats(SimStats stats)

[*] m_scriptLinesPerSecond = stats.ExtraStatsBlock[0].StatValue;

[*]public float ScriptLinesPerSecond { get { return m_scriptLinesPerSecond; } }

[/list]

Region/OptionalModules/UserStatistics/SimStatsAJAX.cs

[list]

[*]Creates a JSON blob, with "ScrLPS" set to sdata.ScriptLinesPerSecond at -

[*]http://grid.org:9105/jsonSimStats

[*]9105 is the sims httplistenerport

[*]jsonSimStats is defined in [Startup] Stats_URI

[/list]

Region/Framework/Scenes/Scene.cs

[list]

[*]StatsReporter.OnSendStatsResult += SendSimStatsPackets;

[*]SendSimStatsPackets(SimStats stats)

[*]ForEachRootClient(delegate(IClientAPI client) {client.SendSimStats(stats);});

[/list]

Region/ClientStack/Linden/UDP/LLClientView.cs

[list]

[*]SendSimStats(SimStats stats)

[*]SimStatsPacket pack = new SimStatsPacket();

[*]pack.Stat = stats.StatsBlock; // Ignores ExtraStatsBlock

[*]OutPacket(pack, ThrottleOutPacketType.Task)

[/list]

Region/CoreModules/Framework/Statistics/Logging/BinaryLoggingModule.cs

[list]

[*]m_scene.StatsReporter.OnSendStatsResult += LogSimStats;

[*]LogSimStats(SimStats stats)

[*]SimStatsPacket pack = new SimStatsPacket();

[*]pack.Stat = stats.StatsBlock; // Ignores ExtraStatsBlock

[*]m_statLog.Log.Write(pack.ToBytes());

[/list]

So sbex ends up being ignored by all but the JSON based sim stats web page.


2019-06-01 16:06:46 onefang: The sim console command "show scene" reports "Script lines processed per second" which comes from -

Region/CoreModules/World/Region/RegionCommandsModule.cs

[list]

[*]SimStatsReporter r = m_scene.StatsReporter;

[*]float[] stats = r.LastReportedSimStats;

[*]float scriptLinesPerSecond = stats[23];

[/list]

Region/Framework/Scenes/SimStatsReporter.cs

[list]

[*]sb[23].StatID = (uint)Stats.VirtualSizeKb;

[/list]


2019-06-01 16:09:43 onefang: The stats shown in the sim console on a regular basis comes from -

Framework/Monitoring/SimExtraStatsCollector.cs

[list]

[*]ReceiveClassicSimStatsPacket(SimStats stats)

[*]scriptLinesPerSecond = stats.ExtraStatsBlock[0].StatValue;

[/list]


2019-06-01 16:23:42 onefang: In summary -

The "script lines per second" collecting is really collecting "script functions per second".  So just a vague guess really.

The stats outputs come in four varieties -

[list=1]

[*]The viewer statistics bar.

[*]The sims web server as a JSON blob.

[*]The regular stats info dump in the sims console.

[*]The sims console command "show scene".

[/list]

  1. I think is showing it as "Spare Frame Time".

  2. Is showing it as "ScrLPS", correctly.

  3. Is showing it as "ScrLPS", correctly.

  4. Is showing "VirtualSizeKb" which I think is hard coded to 0.

So only half of them are a bad approximation of the correct value, the rest are entirely wrong.


2019-06-01 16:24:39 onefang: Likely not worth fixing, but can be reopened later maybe.